const tabbar = [
  ''
] as const
const prefix = '/pages/', suffix = '/index'
const page = {
  ...tabbar.reduce(
    (p, c) => ({ ...p, [c]: c }), 
    <Record<typeof tabbar[number], string>>{}
  )
}
export const routerName = Object.entries(page).reduce((p, c) => {
  const [key, url] = c
  p[key] = prefix + url + suffix
  return p
}, <Record<keyof typeof page, string>>{})
    
export const isTabbar = (route: string | undefined) => {
  return tabbar.some(key => {
    const r = routerName[key]
    return route === r
      || route?.startsWith(r) && route?.slice(r.length + 1, r.length + 2) === '?'
  })
}